<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>

<c:set var="contextRootPath" value="${pageContext.request.contextPath}" />
<c:if test="${pageContext.request.contextPath == '/'}">
	<c:set var="contextRootPath" value="" />
</c:if>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>ICE耗时日志</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="${contextRootPath}/resource/easyui-themes/default/easyui.css" />
<link rel="stylesheet" type="text/css" href="${contextRootPath}/resource/easyui-themes/icon.css" />
<script language="javascript">
	// 是否需要重新刷新页面
	var g_needReloadPage = false;
</script>
<script type="text/javascript" src="${contextRootPath}/resource/js/jquery.easyui-1.4.min.js">
	
</script>
</head>
<body>
	<div>
		<span class="page_titile">ICE耗时日志</span>
	</div>

	<form method="get" action="list.do">
		<table class="input_table" align="center" cellspacing="0" cellpadding="0">
			<tr>
				<td class="input_titile_td">查询日期</td>
				<td class="input_content_td"><input class="easyui-datebox" type="text" name="time" value="<c:out value='${time}' />" /></td>
				<td class="input_titile_td">开始时间</td>
				<td class="input_content_td"><input class="easyui-timespinner" type="text" name="start_time" value="<c:out value='${start_time}' />" /> -- <input class="easyui-timespinner" type="text"
					name="end_time" value="<c:out value='${end_time}' />" /></td>
				<td class="input_titile_td">调用方法</td>
				<td class="input_content_td"><input type="text" name="api" value="<c:out value='${api}' />" /></td>
			</tr>
			<tr>
				<td class="input_titile_td">业务代码</td>
				<td class="input_content_td"><input type="text" name="code" value="<c:out value='${code}' />" /></td>
				<td class="input_titile_td">业务请求标识</td>
				<td class="input_content_td"><input type="text" name="flow_id" value="<c:out value='${flow_id}' />" /></td>
				<td class="input_titile_td">请求结果</td>
				<td class="input_content_td"><input type="text" name="result" value="<c:out value='${result}' />" /></td>
			</tr>
			<tr>
				<td class="input_titile_td">dir(0：被动调用；1：主动调用)</td>
				<td class="input_content_td"><input type="text" name="dir" value="<c:out value='${dir}' />" /></td>
				<td class="input_content_td" align="center" colspan="6"><input type="submit" value=" 搜索 " /></td>
			</tr>
		</table>
	</form>

	<form:form method="get" action="list.do" name="frmTurnPage1">
		<input type="hidden" name="time" value="<c:out value='${time}' />" />
		<input type="hidden" name="start_time" value="<c:out value='${start_time}' />" />
		<input type="hidden" name="end_time" value="<c:out value='${end_time}' />" />
		<input type="hidden" name="api" value="<c:out value='${api}' />" />
		<input type="hidden" name="code" value="<c:out value='${code}' />" />
		<input type="hidden" name="flow_id" value="<c:out value='${flow_id}' />" />
		<input type="hidden" name="result" value="<c:out value='${result}' />" />
		<input type="hidden" name="dir" value="<c:out value='${dir}' />" />
		<!-- 隐含变量 -->
		<jsp:include page="/WEB-INF/jsp/common/turnPage.jsp">
			<jsp:param name="formName" value="frmTurnPage1" />
		</jsp:include>
	</form:form>

	<form action="delRecords.do" onsubmit="return Util.confirmSelectedCheckboxes(this, 'checkAll', '请选择要删除的 记录信息', '确认要删除这些 记录信息吗?');">

		<table class="records_table" align="center" cellspacing="0" cellpadding="0">
			<tr class="records_table_head">
				<td>id</td>
				<td>时间</td>
				<td>ip地址</td>
				<td>业务代码</td>
				<td>调用类型(dir)<br />0：被动调用<br />1：主动调用
				</td>
				<td>业务请求标识</td>
				<td>调用序列</td>
				<td>调用方法名称</td>
				<td>耗时</td>
				<td>请求结果</td>
				<td>创建时间</td>
				<td>操作</td>
			</tr>
			<c:forEach items="${pageData.resultList}" var="record">
				<tr class="records_table_record">
					<td><c:out value="${record.id}" /></td>
					<td><fmt:formatDate value="${record.time}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
					<td><c:out value="${record.host}" /></td>
					<td><c:out value="${record.code}" /></td>
					<td><c:out value="${record.dir}" /></td>
					<td><c:out value="${record.flow_id}" /></td>
					<td><c:out value="${record.seq}" escapeXml="false" /></td>
					<td><c:out value="${record.api}" /></td>
					<td><c:out value="${record.cost}" /></td>
					<td><c:out value="${record.result}" /></td>
					<td><fmt:formatDate value="${record.createtTime}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
					<td><a
						href="javascript: g_needReloadPage = false; Util.popupIframeCenter('popupDiv', 600, 400, 'popupTitle', 'ICE耗时日志', 'popupIframe', 'show.do?id=<c:out value="${record.id}" />&time=<fmt:formatDate value="${record.time}" pattern="yyyy-MM-dd HH:mm:ss" />');">查看</a>
					</td>
				</tr>
			</c:forEach>
		</table>

	</form>

	<form:form method="get" action="list.do" name="frmTurnPage2">
		<input type="hidden" name="time" value="<c:out value='${time}' />" />
		<input type="hidden" name="start_time" value="<c:out value='${start_time}' />" />
		<input type="hidden" name="end_time" value="<c:out value='${end_time}' />" />
		<input type="hidden" name="api" value="<c:out value='${api}' />" />
		<input type="hidden" name="code" value="<c:out value='${code}' />" />
		<input type="hidden" name="flow_id" value="<c:out value='${flow_id}' />" />
		<input type="hidden" name="result" value="<c:out value='${result}' />" />

		<!-- 隐含变量 -->
		<jsp:include page="/WEB-INF/jsp/common/turnPage.jsp">
			<jsp:param name="formName" value="frmTurnPage2" />
		</jsp:include>
	</form:form>

	<div id='popupDiv' style="position: absolute; z-index: 9999; width: 300px; height: 250; display: none;" class="popup_style">
		<div class="close" onclick="javascript: $('#popupDiv').hide(); if (g_needReloadPage) location.reload();"></div>
		<div class="title">
			<h2 id="popupTitle"></h2>
		</div>
		<div class="content">
			<iframe id="popupIframe" src="" frameborder="0" scrolling="auto" width="100%" height="100%"></iframe>
		</div>
	</div>

</body>
</html>